chore(ci): add scheduled workflow to auto-update vendored OpenAPI specs#248
chore(ci): add scheduled workflow to auto-update vendored OpenAPI specs#248marythought wants to merge 5 commits intomainfrom
Conversation
Runs daily at 01:42 UTC (+ manual dispatch). When upstream specs in opentdf/platform have changed, opens a PR on chore/update-vendored-specs (or updates the existing branch if a PR is already open). Closes #247 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughA new GitHub Actions workflow adds a scheduled (daily) and manual job to run Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Scheduler as GitHub Cron / Manual
participant Runner as Actions Runner
participant Repo as Repository (git)
participant Node as Node/npm
participant GH as GitHub (gh CLI / PRs)
Scheduler->>Runner: trigger workflow
Runner->>Repo: checkout code
Runner->>Node: setup Node v22, npm ci
Runner->>Node: run `npm run update-vendored-yaml`
Node->>Repo: update files under `specs/`
Runner->>Repo: run `git status --porcelain specs/`
alt specs changed
Runner->>GH: query existing PR from `chore/update-vendored-specs`
Runner->>Repo: rebase/force-update branch `chore/update-vendored-specs` from main
Runner->>Node: re-run update, commit changes to `specs/`
Runner->>Repo: force-push branch
GH-->>Runner: update or create PR targeting `main`
else no changes
Runner->>Runner: exit without PR changes
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/update-vendored-specs.yaml (1)
8-10: Add workflow concurrency to prevent branch update races.Scheduled and manual runs can overlap and contend on force-push to the same branch. A concurrency group makes this predictable.
Proposed fix
jobs: update-specs: + concurrency: + group: update-vendored-specs + cancel-in-progress: true runs-on: ubuntu-latest🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/update-vendored-specs.yaml around lines 8 - 10, Add a top-level concurrency stanza to the workflow to prevent overlapping runs for the update-specs job: define a concurrency group (e.g., "update-vendored-specs" or include the workflow name/ref like "update-vendored-specs-${{ github.ref }}") and set cancel-in-progress: true so scheduled and manual runs don’t race when force-pushing; update the .github/workflows/update-vendored-specs.yaml workflow (affecting the update-specs job) to include this concurrency configuration at the workflow root.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/update-vendored-specs.yaml:
- Line 65: The current command string 'git fetch origin "$BRANCH" 2>/dev/null &&
git checkout "$BRANCH" && git merge origin/main --no-edit || git checkout -b
"$BRANCH"' can run the branch-creation fallback when the merge fails; change the
flow to deterministically detect whether the branch exists before attempting
merge. Replace with a two-step guarded sequence: first fetch, then test for the
branch (e.g., use 'git rev-parse --verify --quiet "refs/heads/$BRANCH"' or 'git
show-ref --quiet refs/heads/"$BRANCH"') and if it exists run 'git checkout
"$BRANCH" && git merge origin/main --no-edit', otherwise run 'git checkout -b
"$BRANCH"'. Ensure the test is used instead of relying on shell &&/|| chaining
so a failed merge will not trigger branch creation.
---
Nitpick comments:
In @.github/workflows/update-vendored-specs.yaml:
- Around line 8-10: Add a top-level concurrency stanza to the workflow to
prevent overlapping runs for the update-specs job: define a concurrency group
(e.g., "update-vendored-specs" or include the workflow name/ref like
"update-vendored-specs-${{ github.ref }}") and set cancel-in-progress: true so
scheduled and manual runs don’t race when force-pushing; update the
.github/workflows/update-vendored-specs.yaml workflow (affecting the
update-specs job) to include this concurrency configuration at the workflow
root.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 25fd1f09-1be3-43be-8e5f-c1f79d813e27
📒 Files selected for processing (1)
.github/workflows/update-vendored-specs.yaml
- Replace fragile &&/|| chain with `git checkout -B` from origin/main to avoid merge-conflict fallback creating a new branch - Add workflow concurrency group to prevent overlapping runs from racing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Adds a daily workflow that runs
npm run update-vendored-yamland opens a PR if specs have drifted from upstreamopentdf/platform. Also supports manualworkflow_dispatch.chore/update-vendored-specsbranch and opens a PRCloses #247
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit